package com.itx.gatewayx.common.constants;

/**
 * 系统常量
 *
 * @author itx
 */
public class SystemConstants {

    /**
     * 令牌前缀
     */
    public static final String TOKEN_PREFIX = "Bearer ";

    /**
     * 授权信息头
     */
    public static final String AUTHORIZATION_HEADER = "Authorization";

    /**
     * 用户ID传递请求头
     */
    public static final String USER_ID_HEADER = "X-User-Id";

    /**
     * 刷新令牌头
     */
    public static final String REFRESH_TOKEN_HEADER = "Refresh-Token";

    /**
     * 登录用户 Redis Key
     */
    public static final String LOGIN_TOKEN_KEY = "login_tokens:";

    /**
     * 黑名单 Redis Key
     */
    public static final String BLACK_TOKEN_KEY = "black_tokens:";

    /**
     * 验证码 Redis Key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 2;

    /**
     * 防重提交 Redis Key
     */
    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";

    /**
     * 系统用户授权缓存
     */
    public static final String SYS_AUTH_CACHE = "sys-auth:";

    /**
     * 角色权限缓存前缀
     */
    public static final String ROLE_PERMISSION_KEY = "role_permissions:";

    /**
     * 路由配置缓存前缀
     */
    public static final String ROUTE_CONFIG_KEY = "route_configs:";

    /**
     * 限流器前缀
     */
    public static final String RATE_LIMITER_KEY = "rate_limiter:";

    /**
     * API访问统计前缀
     */
    public static final String API_STATISTICS_KEY = "api_statistics:";

    /**
     * 管理员角色编码
     */
    public static final String ADMIN_ROLE_CODE = "ROLE_ADMIN";
    
    /**
     * 管理员ID
     */
    public static final Long ADMIN_ID = 1L;
    
    /**
     * 用户默认头像
     */
    public static final String DEFAULT_AVATAR = "https://api.dicebear.com/7.x/avataaars/svg?seed=";
    
    /**
     * 系统正常状态
     */
    public static final Integer STATUS_NORMAL = 0;
    
    /**
     * 系统停用状态
     */
    public static final Integer STATUS_DISABLE = 1;
    
    /**
     * 请求成功编码
     */
    public static final Integer SUCCESS_CODE = 200;
    
    /**
     * 请求失败编码
     */
    public static final Integer ERROR_CODE = 500;
    
} 